package com.tcl.feign.feign;

import com.tcl.api.request.UserAddRequest;
import com.tcl.api.response.ResultMsg;
import com.tcl.api.response.UserResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 基于 SpringContract 拓展契约
 */
@RequestMapping("/user")
public interface UserServiceFeignClient02 {

    @GetMapping("/get")
    UserResponse get(@RequestParam("id") Integer id);

    @PostMapping("/get2")
    UserResponse get2(@RequestParam("id") Integer id);

    @GetMapping("/get3")
    ResultMsg get3(@RequestParam("id") Integer id);

    //===============================================================
    @GetMapping("/list")
    List<UserResponse> list(@RequestParam(value = "name") String name, @RequestParam(value = "gender") Integer gender);

    @GetMapping("/list2")
    List<UserResponse> list2(UserAddRequest request);


    //===============================================================
    @PostMapping("/add")
    Integer add(@RequestBody UserAddRequest request);

    @PostMapping("/add2")
    Integer add2(UserAddRequest request);

    //============================异常测试=================
    @GetMapping("/error")
    ResultMsg error(@RequestParam("id") Integer id);
}
